<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>购物车</title>
<meta name="Description" content="道具商城，游戏商城，英雄联盟道聚城购物车">
<meta name="Keywords" content="道具商城，游戏商城，英雄联盟，lol，购物车，道具购买">
<meta name="author" content="cry">
<link rel="stylesheet" type="text/css" href="animate.css-master/animate.min.css">
<link rel="stylesheet" type="text/css" href="shopping.css">
</head>

<body>
<!--	右侧固定栏-->
<div id="FanHui">
		<a href="#Top">
		返回顶部
		</a>
</div>
<div class="All animated lightSpeedIn">
		<!--		顶部登陆-->
		<div id="Top" class="clearbox">
				<div class="Lan">
						<div class="Lan-left">
								<a href="#">
								<span></span> 手机版
								</a>
								<span>|</span>
								<a href="#">
								Q币充值
								</a>
						</div>
						<div class="Lan-right">
								<ul>
										<li>
												<a href="#">
												未登陆，请登陆
												</a>
												<span>|</span>
										</li>
										<li>
												<a href="#">
												我的订单
												</a>
												<span>|</span>
										</li>
										<li>
												<a href="#">
												个人中心
												</a>
												<span>|</span>
										</li>
										<li>
												<a href="#">
												帮助中心
												</a>
												<span>|</span>
										</li>
										<li>
												<a href="#">
												游戏导航
												</a>
										</li>
								</ul>
						</div>
				</div>
		</div>
		
		<!--		中部广告栏-->
		<div id="Middle" class="clearbox">
				<div class="Middle-up">
						<div class="Middle-up-left">
								<a href="#">
								</a>
						</div>
						<div class="Middle-up-middle">
								<a href="#">
								</a>
								<input type="text" placeholder="输入道具搜索">
						</div>
						<div class="Middle-up-right">
								<a href="#">
								</a>
						</div>
				</div>
				<div class="Middle-down">
						<div class="Middle-down-top">
								<ul>
										<li>
												<a href="#">
												首页
												</a>
										</li>
										<li>
												<a href="#">
												商品列表
												</a>
										</li>
										<li>
												<a href="#">
												活动专区
												</a>
										</li>
										<li>
												<a href="#">
												限时折扣
												</a>
										</li>
										<li>
												<a href="#">
												聚豆乐园
												</a>
										</li>
										<li>
												<a href="#">
												周边商城
												</a>
										</li>
										<li>
												<a href="#">
												个人中心
												</a>
										</li>
								</ul>
								<div class="Middle-down-top-right">
										<a href="#">
										<i>（4）</i>
										<span></span> 购物车
										</a>
								</div>
						</div>
				</div>
		</div>
		
		<!--		位置提示-->
		<div id="Address">
				<a href="#">
				您现在的位置：&gt;购物车
				</a>
		</div>
		
		<!--		信息展示-->
		<div id="Message">
				<!--			收货信息-->
				<div class="Message-SH">
						<div>收货角色信息</div>
						<p>选择游戏角色:</p>
						<form action="#">
								<select name="GameName">
										<option value="">请选择大区</option>
										<option>艾欧尼亚 电信</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
								</select>
								<select name="GameName">
										<option value="">请选择角色</option>
										<option>艾欧尼亚 电信</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
										<option>峡谷之巅</option>
								</select>
						</form>
				</div>
				<!--			商品信息-->
				<div class="Message-SP">
						<div class="Message-SP-message">商品信息</div>
						<div class="Message-SP-top">
								<div class="Message-SP-top-left">
										<input class="check_all" type="checkbox" name="全选">
										全选 <span>商品名称</span>
								</div>
								<div class="Message-SP-top-right">
										<ul>
												<li>
														<span>类型</span>
												</li>
												<li>
														<span>单价</span>
												</li>
												<li>
														<span>期限</span>
												</li>
												<li>
														<span>数量</span>
												</li>
												<li>
														<span>优惠</span>
												</li>
												<li>
														<span>小计</span>
												</li>
												<li>
														<span>操作</span>
												</li>
										</ul>
								</div>
						</div>
						<div class="Message-SP-bottom shopCon">
								<div class="Message-SP-bottom-left">
										<input class="check_min" type="checkbox" name="全选">
										<img src="34202-3349-.jpg" width="39" height="28" alt="">
										<span>再见!</span>
								</div>
								<div class="Message-SP-bottom-right">
										<ul>
												<li>
														<span>表情</span>
												</li>
												<li>
														<p class="price_min" style="float: left;padding-left: 20px;">20.00</p><span style="float: left;">Q币</span>
												</li>
												<li>
														<span>永久</span>
												</li>
												<li>
														<a class="jian" href="#">
														-
														</a>
														<input style="width: 16px;text-align: center;" class="text" type="text" name="text" value="1">
														<a class="jia" href="#">
														+
														</a>
												</li>
												<li>
														<span>无优惠</span>
												</li>
												<li>
														<p class="price" style="float: left;padding-left: 20px;">20.00</p><span style="float: left;">Q币</span>
												</li>
												<li>
														<a style="float: left;margin-left: 24px;" href="#">
														关注</a>
														<p style="float: left;font-size: 12px;color: blue;margin-left: 5px;">删除</p>
												</li>
										</ul>
								</div>
						</div>
						<div class="Message-SP-bottom">
								<div class="Message-SP-bottom-left">
										<input class="check_min" type="checkbox" name="全选">
										<img src="34202-3349-.jpg" width="39" height="28" alt="">
										<span>再见!</span>
								</div>
								<div class="Message-SP-bottom-right">
										<ul>
												<li>
														<span>表情</span>
												</li>
												<li>
														<p class="price_min" style="float: left;padding-left: 20px;">20.00</p><span style="float: left;">Q币</span>
												</li>
												<li>
														<span>永久</span>
												</li>
												<li>
														<a class="jian" href="#">
														-
														</a>
														<input style="width: 16px;text-align: center;" class="text" type="text" name="text" value="1">
														<a class="jia" href="#">
														+
														</a>
												</li>
												<li>
														<span>无优惠</span>
												</li>
												<li>
														<p class="price" style="float: left;padding-left: 20px;">20.00</p><span style="float: left;">Q币</span>
												</li>
												<li>
														<a style="float: left;margin-left: 24px;" href="#">
														关注</a>
														<p style="float: left;font-size: 12px;color: blue;margin-left: 5px;">删除</p>
												</li>
										</ul>
								</div>
						</div>
				</div>
				<!--			优惠信息-->
				<div class="Message-YH">
						<div class="Message-YH-message">您的优惠信息</div>
						<p>优惠券总量：<span>0</span></p>
						<a href="#">
						如何获得优惠券&gt;&gt;
						</a>
				</div>
				<!--			提交订单-->
				<div class="Message-TJ">
						<form action="#">
								<button type="submit" value="提交订单">提交订单</button>
						</form>
						<p>实付款<span id="totalPrice">0.00</span>Q币</p>
				</div>
		</div>
		
		<!--		底部栏-->
		<div id="Bottom" class="clearbox">
				<div class="Bottom-up">
						<div class="Bottom-up-left">
								<ul>
										<li>
												<h4>我是新手</h4>
												<ul>
														<li>
																<a href="#">
																什么是道聚城
																</a>
														</li>
														<li>
																<a href="#">
																如何购买
																</a>
														</li>
														<li>
																<a href="#">
																如何赠送
																</a>
														</li>
														<li>
																<a href="#">
																如何获取聚豆
																</a>
														</li>
												</ul>
												<span></span>
										</li>
										<li>
												<h4>个人中心</h4>
												<ul>
														<li>
																<a href="#">
																发货时间
																</a>
														</li>
														<li>
																<a href="#">
																如何领取
																</a>
														</li>
														<li>
																<a href="#">
																补发规则
																</a>
														</li>
														<li>
																<a href="#">
																Vip价定义
																</a>
														</li>
														<li>
																<a href="#">
																道具状态定义
																</a>
														</li>
												</ul>
												<span></span>
										</li>
										<li>
												<h4>我是新手</h4>
												<ul>
														<li>
																<a href="#">
																什么是道聚城
																</a>
														</li>
														<li>
																<a href="#">
																如何购买
																</a>
														</li>
														<li>
																<a href="#">
																如何赠送
																</a>
														</li>
														<li>
																<a href="#">
																如何获取聚豆
																</a>
														</li>
												</ul>
												<span></span>
										</li>
										<li>
												<h4>腾讯在线服务</h4>
												<ul>
														<li>
																<a href="#">
																腾讯官方在线客服
																</a>
														</li>
												</ul>
												<span></span>
										</li>
								</ul>
						</div>
						<div class="Bottom-up-right">
								<ul>
										<li>
												<div>
														<img src="zsdjc.png" alt="" width="100" height="100">
												</div>
												<p>掌上道聚城</p>
										</li>
										<li>
												<div>
														<img src="wechatdjc.png" alt="">
												</div>
												<p>道聚城公众号</p>
										</li>
								</ul>
						</div>
				</div>
				<div class="Bottom-down">
						<p>
								<a href="#">
								腾讯互动娱乐
								</a>
								|
								<a href="#">
								服务条款
								</a>
								|
								<a href="#">
								腾讯游戏隐私保护指引
								</a>
								|
								<a href="#">
								腾讯游戏儿童隐私保护指引
								</a>
								|
								<a href="#">
								广告服务
								</a>
								|
								<a href="#">
								腾讯游戏招聘
								</a>
								|
								<a href="#">
								腾讯游戏客服
								</a>
								|
								<a href="#">
								游戏地图
								</a>
								|
								<a href="#">
								成长守护平台
								</a>
								|
								<a href="#">
								商务合作
								</a>
								|
								<a href="#">
								网站导航
								</a>
						</p>
						<p>COPYRIGHT © 1998 – 2020 TENCENT. ALL RIGHTS RESERVED.</p>
						<p>
								<a href="#">
								腾讯公司
								</a>
								<a href="#">
								版权所有
								</a>
						</p>
				</div>
		</div>
</div>
</body>
	<script type="text/javascript">
		var chAll = document.getElementsByClassName('check_all');
		var chMin = document.getElementsByClassName('check_min');
		var addition = document.getElementsByClassName('jia');
		var subtraction = document.getElementsByClassName('jian');
		var inp = document.getElementsByClassName('text');
		var xiaoJi = document.getElementsByClassName('price');
		var danJia = document.getElementsByClassName('price_min');
		var zongJia = document.getElementById('totalPrice');
		var del01 = xiaoJi[0].parentElement.nextElementSibling.lastElementChild;
		var del02 = xiaoJi[1].parentElement.nextElementSibling.lastElementChild;
		
		console.log(chAll)
		var shopGoods = document.getElementsByClassName('shopCon');
		
		del01.onclick = function(){
			if(confirm('你真的想要删除此商品嘛？')){
				shopGoods[0].remove();
			}
			
		}
		del02.onclick = function(){
			if(confirm('你真的想要删除此商品嘛？')){
				shopGoods[0].remove();
			}
		}
		
//		function(){
//			if((chMin[0].checked == true) && (chMin[1].checked == true)){
//				chAll[0].checked = true;
//			}
//		}
		
		chAll[0].onclick = function(){
					if(chAll[0].checked == true){
						
						chMin[0].checked = true;
						chMin[1].checked = true;
						
						
						
						zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);


						addition[0].onclick = function(){
							inp[0].value = parseInt(inp[0].value) + 1;
							xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
							
							zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
						}

						subtraction[0].onclick = function(){
							if((parseInt(inp[0].value)) >1){
								inp[0].value = parseInt(inp[0].value) - 1;
								xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
								
								zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

							}
							else
								alert("至少选择一种商品");
						}

						addition[1].onclick = function(){
							inp[1].value = parseInt(inp[1].value) + 1;
							xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
						
							zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

						}

						subtraction[1].onclick = function(){
							if((parseInt(inp[1].value)) > 1){
								inp[1].value = parseInt(inp[1].value) - 1;
								xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
								
								zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
							}
							else
								alert("至少选择一种商品");
						}
						
						
						chMin[0].onclick =function(){
							if(chMin[1].checked == false){
								chAll[0].checked = false;
								
								if(chMin[0].checked == false){
										chAll[0].checked = false;
										
									
										zongJia.innerHTML = 0;
									}
								else{
									chAll[0].checked = false;
									
									zongJia.innerHTML = parseFloat(xiaoJi[0].innerHTML);
								

									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
									
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
										

										}
										else
											alert("至少选择一种商品");
									}

								}
							}
							else if(chMin[1].checked == true){
								chAll[0].checked = false;
								
								if(chMin[0].checked == true){
								
									zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);


									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
									
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
									
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

										}
										else
											alert("至少选择一种商品");
									}

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
									
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
										
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
										}
										else
											alert("至少选择一种商品");
									}
								}
								else if(chMin[0].checked == false){
									chAll[0].checked = false;
									
									zongJia.innerHTML = parseFloat(xiaoJi[1].innerHTML);
									
							

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
								
									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) >1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[1].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									

										}
										else
											alert("至少选择一种商品");
									}
								}

							}
						}


						chMin[1].onclick =function(){
							if(chMin[0].checked == false){
								chAll[0].checked = false;
								
								if(chMin[1].checked == false){
										chAll[0].checked = false;
									
							
										zongJia.innerHTML = 0;
									}
								else{
									chAll[0].checked = false;
								
									zongJia.innerHTML = parseFloat(xiaoJi[1].innerHTML);
							

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
							
									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									
										}
										else
											alert("至少选择一种商品");
									}

								}
							}
							else if(chMin[0].checked == true){
								chAll[0].checked = false;
							
								if(chMin[1].checked == true){
								
									zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);


									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
								
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
								
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

										}
										else
											alert("至少选择一种商品");
									}

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
								
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
								
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
										}
										else
											alert("至少选择一种商品");
									}
								}
								else if(chMin[1].checked == false){
									chAll[0].checked = false;
								
									zongJia.innerHTML = parseFloat(xiaoJi[0].innerHTML);
							

									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
							
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
							

										}
										else
											alert("至少选择一种商品");
									}
								}
									
							}
						}
							
					}
					else{
						
						chMin[0].checked = false;
						chMin[1].checked = false;
				
						zongJia.innerHTML = 0;

					}
		}
		
		chMin[0].onclick =function(){
							if(chMin[1].checked == false){
								chAll[0].checked = false;
								
								if(chMin[0].checked == false){
										chAll[0].checked = false;
									
								
										zongJia.innerHTML = 0;
									}
								else{
									chAll[0].checked = false;
								
									zongJia.innerHTML = parseFloat(xiaoJi[0].innerHTML);
							
									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
					
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
							

										}
										else
											alert("至少选择一种商品");
									}

								}
							}
							else if(chMin[1].checked == true){
								chAll[0].checked = false;
								
								if(chMin[0].checked == true){
						
									zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);


									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
					
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
					
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

										}
										else
											alert("至少选择一种商品");
									}

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
				
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
						
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
										}
										else
											alert("至少选择一种商品");
									}
								}
								else if(chMin[0].checked == false){
									chAll[0].checked = false;
								
									zongJia.innerHTML = parseFloat(xiaoJi[1].innerHTML);
									
				

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
			
									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) >1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[1].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
						

										}
										else
											alert("至少选择一种商品");
									}
								}

							}
						}


						chMin[1].onclick =function(){
							if(chMin[0].checked == false){
								chAll[0].checked = false;
								
								if(chMin[1].checked == false){
										chAll[0].checked = false;
									

										zongJia.innerHTML = 0;
									}
								else{
									chAll[0].checked = false;
									
									zongJia.innerHTML = parseFloat(xiaoJi[1].innerHTML);
					

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
						
									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
						
										}
										else
											alert("至少选择一种商品");
									}

								}
							}
							else if(chMin[0].checked == true){
								chAll[0].checked = false;
							
								if(chMin[1].checked == true){
				
									zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);


									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
					
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
							
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

										}
										else
											alert("至少选择一种商品");
									}

									addition[1].onclick = function(){
										inp[1].value = parseInt(inp[1].value) + 1;
										xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
				
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);

									}

									subtraction[1].onclick = function(){
										if((parseInt(inp[1].value)) > 1){
											inp[1].value = parseInt(inp[1].value) - 1;
											xiaoJi[1].innerHTML = (parseFloat(danJia[1].innerHTML) * parseInt(inp[1].value)).toFixed(2);
								
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML) + parseFloat(xiaoJi[1].innerHTML)).toFixed(2);
										}
										else
											alert("至少选择一种商品");
									}
								}
								else if(chMin[1].checked == false){
									zongJia.innerHTML = parseFloat(xiaoJi[0].innerHTML);
						

									addition[0].onclick = function(){
										inp[0].value = parseInt(inp[0].value) + 1;
										xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
										zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
						
									}

									subtraction[0].onclick = function(){
										if((parseInt(inp[0].value)) >1){
											inp[0].value = parseInt(inp[0].value) - 1;
											xiaoJi[0].innerHTML = (parseFloat(danJia[0].innerHTML) * parseInt(inp[0].value)).toFixed(2);
											zongJia.innerHTML = (parseFloat(xiaoJi[0].innerHTML)).toFixed(2);
						

										}
										else
											alert("至少选择一种商品");
									}
								}
									
							}
						}
		
		
		
		
		
		
		 
	</script>
</html>
